home *** CD-ROM | disk | FTP | other *** search
/ Armageddon - Interactive Preview / Interactive Preview: Armageddon.iso / pc / control.dxr / Scripts & Behaviors_29_Bio Scan Line.ls < prev    next >
Encoding:
Text File  |  1998-05-19  |  889 b   |  32 lines

  1. property pThisSprite, pScanState, pStartPos, pEndPos, pCurrentPos
  2.  
  3. on new me
  4.   set pThisSprite to the currentSpriteNum
  5.   set pScanState to 0
  6.   set pStartPos to the locV of sprite pThisSprite
  7.   set pEndPos to pStartPos + 30
  8.   set the visible of sprite pThisSprite to 0
  9. end
  10.  
  11. on exitFrame me
  12.   case pScanState of
  13.     0:
  14.       set thisRandom to random(100)
  15.       if thisRandom = 100 then
  16.         set pScanState to 1
  17.         set the visible of sprite pThisSprite to 1
  18.       end if
  19.     1:
  20.       set pCurrentPos to the locV of sprite pThisSprite
  21.       if pCurrentPos < pEndPos then
  22.         set pCurrentPos to pCurrentPos + 2
  23.         set the locV of sprite pThisSprite to pCurrentPos
  24.       else
  25.         set pCurrentPos to pStartPos
  26.         set the locV of sprite pThisSprite to pCurrentPos
  27.         set pScanState to 0
  28.         set the visible of sprite pThisSprite to 0
  29.       end if
  30.   end case
  31. end
  32.